package Demo16_30.Test16;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by 14229 on 2020/1/21.
 */
public class Test {
    public static void main(String[] args) {
        System.out.println(getYesterdayTime());
    }
    public static String getYesterdayTime(){
        Date d = new Date();
        int i = d.getDate()-1;
        SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM"+-i+" HH:mm:ss");
        String format = sim.format(d);
        return format;
    }
}
